function confirmModify(){
	var userName = $.cookie("youleche.u");
	if(userName == null){
		window.location.href = "noresponse1.jsp";
		return;
	}
	
	var oldpass = $("#txtOldPass").val();
	if(oldpass == ""){
		$("#tdoldpass").html("原始密码不能为空！").css("color", "red");
		return;
	}
	
	var newpass = $("#txtnewpass").val();
	if(newpass == ""){
		$("#tdnewpass").html("新密码不能为空！").css("color", "red");
		return;
	}
	
	var newconpass = $("#txtnewconpass").val();
	if(newconpass == ""){
		$("#tdnewconpass").html("确认新密码不能为空！").css("color", "red");
		return;
	}
	
	if(newconpass != newpass){
		$("#tdnewconpass").html("两次输入密码不一致！").css("color", "red");
		return;
	}
	
	$.ajax({
		type: "post",
		dataType: "text",
		url: "../au.do?action=2&userName="+userName +"&oldpass="+oldpass+"&newpass="+newpass,
		success: function(v){
			if(v == "0"){
				window.parent.location.href = "noresponse1.jsp";
			}else if(v == "1"){
				$("#tdoldpass").html("原密码不正确！").css("color", "red");
			}else if(v == "2"){
				$("#txtnewconpass").val('');
				$("#txtOldPass").val('');
				$("#txtnewpass").val('');
				layer.alert("密码修改成功!", 1);
			}else if(v == "3"){
				layer.alert("修改密码失败!", 2);
			}
		}
	});
}

function release(){
	window.parent.location.href = "../release.jsp";
}

$(function(){
	var u = $.cookie("youleche.u");
	if(u == null){
		window.parent.location.href = "noresponse1.jsp";
	}else{
		$("#txtUserName").val(u)
	}
	
	$("#txtOldPass").live("focusin",function(){
		$("#tdoldpass").html('');
	});
	
	$("#txtnewpass").live("focusin",function(){
		$("#tdnewpass").html('');
	});
	
	$("#txtnewconpass").live("focusin",function(){
		$("#tdnewconpass").html('');
	});	
});